<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>p5_溢出替换为省略号</title>
    <style>
        div{
            background-color: yellow;
            /*必须设置搜在区域的大小*/
            width: 200px;
            /*一下三局为组合代码 缺一不可*/
            white-space: nowrap;
            /*溢出的文字隐藏*/
            overflow: hidden;
            /*有文字溢出则替换为省略号*/
            text-overflow: ellipsis;
        }
    </style>
</head>
<body>
<div>
    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi at delectus distinctio fuga iusto neque pariatur placeat porro quae, repellat sint, sunt tempore, voluptatibus. Adipisci aut et libero molestiae neque!
</div>
</body>
</html>